<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const arr = [1, 2, 3]
        //map返回值是根据回调函数返回结果的布尔值true或false,为ture返回生成的修改后的数组,只有return没有返回值为undefined
        // 没有return返回的也是undefined
        const newArr = arr.map((item, index, arr) => {
            return item += 1
        })
        console.log(newArr)
    </script>
</body>

</html>